from django.http import HttpResponse
from django.shortcuts import render
from django.contrib import admin
from django import http

# Create your views here.
from django.views import View



def my_decorator(func):
    def wrapper(request, *args, **kwargs):
        print('自定义装饰器被调用了')
        print('请求路径%s' % request.path)
        return func(request, *args, **kwargs)
    return wrapper

# 自定义的类视图:
class DemoView(View):
    def get(self, request):
        print('类视图中的 get 方法')
        return HttpResponse('demoview get')

    def post(self, request):
        print('类视图中的 post 方法')
        return HttpResponse('demoview post')